package smartfleet.mobile.vehicle;

import java.io.Serializable;
import java.util.Collection;

import smartfleet.mobile.location.Location;
import smartfleet.mobile.trip.Trip;

public class Vehicle implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1510087371413508180L;
	private int idVehicle;
	private int batteryLevel;
	private String state;
	private Location lastKnowLocation;
	private int seatsAvailable;
	private Location nextDestination;
	private double currentAltitude;
	private Location currentLocation;
	private Collection<Trip> trip;

	public  Vehicle() {
	}
	
	public Vehicle(String id,String batteryLevel,String state,String seatsAvailable){
		this.idVehicle = Integer.parseInt(id);
		this.batteryLevel = Integer.parseInt(batteryLevel);
		this.state = state;
		this.seatsAvailable = Integer.parseInt(seatsAvailable);
	}
	
	public Vehicle(
			String id,
			String batteryLevel,
			String state,
			String seatsAvailable,
			String altitude){
		
		this.idVehicle = Integer.parseInt(id);
		this.batteryLevel = Integer.parseInt(batteryLevel);
		this.state = state;
		this.seatsAvailable = Integer.parseInt(seatsAvailable);
		this.currentAltitude = Double.parseDouble(altitude);
		
	}
	/**
	 * @return the idVehicle
	 */
	public int getIdVehicle() {
		return idVehicle;
	}

	/**
	 * @param idVehicle
	 *            the idVehicle to set
	 */
	public void setIdVehicle(int idVehicle) {
		this.idVehicle = idVehicle;
	}

	/**
	 * @return the batteryLevel
	 */
	public int getBatteryLevel() {
		return batteryLevel;
	}

	/**
	 * @param batteryLevel
	 *            the batteryLevel to set
	 */
	public void setBatteryLevel(int batteryLevel) {
		this.batteryLevel = batteryLevel;
	}

	/**
	 * @return the state
	 */
	public String getState() {
		return state;
	}

	/**
	 * @param state
	 *            the state to set
	 */
	public void setState(String state) {
		this.state = state;
	}

	/**
	 * @return the lastKnowLocation
	 */
	public Location getLastKnowLocation() {
		return lastKnowLocation;
	}

	/**
	 * @param lastKnowLocation
	 *            the lastKnowLocation to set
	 */
	public void setLastKnowLocation(Location lastKnowLocation) {
		this.lastKnowLocation = lastKnowLocation;
	}

	/**
	 * @return the seatsAvailable
	 */
	public int getSeatsAvailable() {
		return seatsAvailable;
	}

	/**
	 * @param seatsAvailable
	 *            the seatsAvailable to set
	 */
	public void setSeatsAvailable(int seatsAvailable) {
		this.seatsAvailable = seatsAvailable;
	}

	/**
	 * @return the nextDestination
	 */
	public Location getNextDestination() {
		return nextDestination;
	}

	/**
	 * @param nextDestination
	 *            the nextDestination to set
	 */
	public void setNextDestination(Location nextDestination) {
		this.nextDestination = nextDestination;
	}

	/**
	 * @return the currentAltitude
	 */
	public double getCurrentAltitude() {
		return currentAltitude;
	}

	/**
	 * @param currentAltitude
	 *            the currentAltitude to set
	 */
	public void setCurrentAltitude(double currentAltitude) {
		this.currentAltitude = currentAltitude;
	}

	/**
	 * @return the currentLocation
	 */
	public Location getCurrentLocation() {
		return currentLocation;
	}

	/**
	 * @param currentLocation
	 *            the currentLocation to set
	 */
	public void setCurrentLocation(Location currentLocation) {
		this.currentLocation = currentLocation;
	}

	/**
	 * @return the trip
	 */
	public Collection<Trip> getTrip() {
		return trip;
	}

	/**
	 * @param trip
	 *            the trip to set
	 */
	public void setTrip(Collection<Trip> trip) {
		this.trip = trip;
	}
	
	public String toString(){
		return this.idVehicle+","+this.state+","+this.batteryLevel+","+this.seatsAvailable;
	}

}
